/**
 * WrongSignException.java 
 * Copyright © 2014-2016, 杭州泊享网络科技有限公司
 * 
 * @author Liu Tao
 * @create 2015年5月22日
 */
package com.pshare.framework.exception;

import com.pshare.enums.CodeMsg;

/**
 * 签名错误Exception
 */
public class WrongSignException extends SeaxRuntimeException {

	private static final long serialVersionUID = -1599232983986664467L;
	private final static Integer code = CodeMsg.WRONG_SIGN.getCode();
	private final static String msgCn = CodeMsg.WRONG_SIGN.getMessage();
	private String msgEn = CodeMsg.WRONG_SIGN.getEnglishMsg();

	public WrongSignException() {
		super(msgCn);
	}

	public WrongSignException(String message) {
		super(message);
	}

	public WrongSignException(Throwable cause) {
		super(cause);
	}

	public WrongSignException(String message, Throwable cause) {
		super(message, cause);
	}

	public Integer getCode() {
		return code;
	}

	public String getMsgEn() {
		return msgEn;
	}

	/**
	 * 根据中英文环境返回不同的信息
	 * 
	 * @param isEN 是否英文
	 * @return String
	 */
	public String getMsg(Boolean isEN) {
		if (isEN == null || !isEN) {
			return getMessage();
		} else {
			return getMsgEn();
		}
	}
}
